package com.hb.medical_research_system.controller;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.api.R;
import com.hb.medical_research_system.common.Results;
import com.hb.medical_research_system.entity.Result;
import com.hb.medical_research_system.entity.User;
import com.hb.medical_research_system.service.UserService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.util.DigestUtils;
import org.springframework.web.bind.annotation.*;

import javax.servlet.http.HttpServletRequest;

@Api(tags = "用户")
@Slf4j
@RestController
@RequestMapping("/user")
public class UserController {

    @Autowired
    private UserService userService;

    /**
     * 修改密码
     * @param oldPwd
     * @param newPwd
     * @return
     */
    @ApiOperation("修改用户密码接口")
    @PostMapping("/modify")
    public Results changePassword(@RequestParam String oldPwd, @RequestParam String newPwd){
        return userService.modifyPassword(oldPwd, newPwd);
    }

}
